package practice08;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: com.gkc
 * @ClassName: DoubleColorSphere
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/12/17 17:15
 * @Copyright 大牛版板所有
 */
public class DoubleColorSphere {
    public static void main(String[] args) {
        Set<Integer> set = new HashSet<>();
        for (int i = 0;; i++) {
            int redNum = (int) (Math.random()*33+1);
            set.add(redNum);
            if (set.size() == 6){
                break;
            }
        }
        int blueNum = (int) (Math.random()*16+1);
        System.out.println("蓝色的球号为："+blueNum);
        System.out.print("红色的球号码为：");
        Iterator<Integer> iter = set.iterator();
        while (iter.hasNext()){
            int num = iter.next();
            System.out.print(num+"\t");
        }
    }
}
